<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = {
            id: 1,
            pname: 'xiaomi',
            price: 19999,
            num:2000
        }
        // var arr = Object.keys(obj)
        // console.log(arr);
        // 新增或者修改以前
        obj.num = 1000;
        obj.price =99;
        console.log(obj);
        //es5新增
        Object.defineProperties(Obj,'num',{
            value:1000
        });
        console.log(obj)
        Object.defineProperties(Obj,'price',{
            value:9.9
        });
        console.log(obj)
    </script>
</body>
</html>